package com.jeeplus.modules.monitor.task;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.quartz.DisallowConcurrentExecution;

import com.jeeplus.modules.monitor.entity.Task;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Slf4j
@DisallowConcurrentExecution
public class TestTask extends Task {

//    @Autowired
//    private TUserService userService;
//
//    @Autowired
//    private SignService signService;

    @Override
    public void run() {

//        List<TUser> list = userService.findList(new TUser());
//        for (TUser tUser : list) {
//            // 查询今天是否签到
//            Sign sign = new Sign();
//            sign.setU(tUser);
//            sign.setDataScope(" and to_days(a.create_date) = to_days(now())");
//            List<Sign> list1 = signService.findList(sign);
//            if (CollectionUtils.isEmpty(list1)) {
//                tUser.setSignCount(0);
//                userService.save(tUser);
//            }
//        }
        log.info("");
        System.out.println("这是测试任务TestTask。");
    }
}
